package unit2;

import java.util.Scanner;

public class Ex2_22_SumBubble {
    public static void main(String[] args) {
        int sum = 0;
        int a[][] = new int[3][3];
        Scanner in = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                a[i][j] = in.nextInt();
            }
        }
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (((i + j) == 2) || (i == j))
                    sum = sum + a[i][j];
            }
        }
        System.out.println("两对角线元素之和为：" + sum);

    }

}
